/* 
 *  javascribd - Java client library for the Scribd API. 
 *  Copyright (C) 2009 by Marcel Eyke, http://code.google.com/p/javascribd/ 
 *  Use is subject to license terms of LGPLv3. See license.txt. 
 */
package com.google.code.javascribd.connection.jaxbadapter;

import javax.xml.bind.annotation.adapters.XmlAdapter;

import com.google.code.javascribd.type.ConversionStatus;

public class ConversionStatusAdapter extends XmlAdapter<String, ConversionStatus> {

	@Override
	public String marshal(ConversionStatus conversionStatus) throws Exception {
		if (conversionStatus == null) {
			return null;
		}
		return conversionStatus.toString();
	}

	@Override
	public ConversionStatus unmarshal(String conversionStatusString) throws Exception {
		if (conversionStatusString == null) {
			return null;
		}
		return ConversionStatus.fromValue(new CDATAStringAdapter().unmarshal(conversionStatusString));
	}

}
